package com.linchong.concurrency.chapter7;

import com.linchong.concurrency.chapter6.ThreadService;
import org.omg.CORBA.OBJ_ADAPTER;

/**
 * @Author:linchong
 * @CreateTime:2020-01-06 22:30
 * @Description:SynchronizedTest
 */
public class SynchronizedTest {

	private final static Object LOCK = new Object();

	public static void main(String[] args) {
		Runnable runnable = () -> {
			synchronized (LOCK) {
				try {
					Thread.sleep(100_000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		};
		Thread t1 = new Thread(runnable);
		Thread t2 = new Thread(runnable);
		Thread t3 = new Thread(runnable);

		t1.start();
		t2.start();
		t3.start();
	}
}
